<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录界面</title>
    <script src="https://unpkg.com/@tailwindcss/browser@4"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
</head>

<body class="bg-gradient-to-br from-gray-800 to-gray-900 min-h-screen flex items-center justify-center font-sans">
    <div class="bg-white bg-opacity-90 p-8 rounded-xl shadow-xl max-w-md w-full">
        <h1 class="text-3xl font-bold text-center text-gray-800 mb-6">登录</h1>
        <form id="loginForm" action="/login" method="post" class="space-y-6">
            <div>
                <label for="username" class="block text-sm font-medium text-gray-700 mb-1">用户名</label>
                <input type="text" id="username" name="username" placeholder="请输入用户名"
                    class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-blue-500">
            </div>
            <div>
                <label for="password" class="block text-sm font-medium text-gray-700 mb-1">密码</label>
                <input type="password" id="password" name="password" placeholder="请输入密码"
                    class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:border-blue-500">
            </div>
            <button type="submit"
                class="w-full bg-blue-500 text-white py-2 px-4 rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">登录</button>
        </form>
        <a href="#" class="block text-center text-gray-600 hover:text-blue-500 mt-4">忘记密码?</a>
        <select id="messageSelect" class="w-full px-3 py-2 border border-gray-300 rounded-md mt-4" disabled></select>
    </div>
    <script>
        const messageSelect = document.getElementById('messageSelect');
        const loginForm = document.getElementById('loginForm');

        loginForm.addEventListener('submit', function (e) {
            // 可以在这里添加表单验证逻辑
            if (!document.getElementById('username').value || !document.getElementById('password').value) {
                e.preventDefault();
                messageSelect.innerHTML = `<option value="error">用户名和密码不能为空</option>`;
            }
        });
    </script>
</body>

</html>    